package com.adapter.classadapter;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/4/15 8:40
 */
public class Phone {
    
    // 充电
    public void charging(IVoltage5V iVoltage5V){
        int v = iVoltage5V.output5V();
        if (v == 5){
            System.out.println("电压为5伏，可以充电");
        } else if (v > 5){
            System.out.println("电压大于5伏，不可充电");
        }
    }
    
}
